<template>
    <el-tooltip class="item" effect="dark" :content="isFavorite ? '已收藏' : '收藏'" placement="top-start">
        <el-button :icon="isFavorite ? 'el-icon-star-on' : 'el-icon-star-off'" :type="isFavorite ? 'info' : 'success'"
            circle @click="favorite"></el-button>
    </el-tooltip>
</template>
<style type="text/scss" lang="scss"></style>
<script>
export default {
    name: "e-favorite",
    data() {
        return {
        }
    },
    props: {
        value: [Boolean, Number],
        module: String,
        id: [String, Number],
        column: [String, Number],
    },
    watch: {},
    computed: {
        isFavoattractionrite() {
            return this.value;
        }
    },
    methods: {
        favorite() {
            this.$favorite(this.module, this.column, this.id).then(res => {
                console.log(`${this.module} column: ${this.column} id: ${this.id} : res : ${res} `);
                this.$emit('input', true);
            });
        }
    },
    created() {

    },
    mounted() {
    },
    destroyed() {
    }
}
</script>
